﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class product_insurance_admin_accept_application : System.Web.UI.Page
{
    CertificateBLL bll = new CertificateBLL(); 

    protected void Page_Load(object sender, EventArgs e)
    {
        ((Admin)this.Master).mainCategory = "CLAIMS";


        if (!IsPostBack)
        {
            int id = int.Parse(Request.QueryString["applicationID"]);
            bll.applicationID = id;
            this.certificate_Repeater.DataSource = bll.getInsuredList();
            this.certificate_Repeater.DataBind();





        }



    }


    protected void btnconfirm_Click(object sender, EventArgs e)
    {
           int id = int.Parse(Request.QueryString["applicationID"]);
           string custId =Request.QueryString["custId"];
      
        var approval = new Approval
        {
            CustID =custId,
            StaffID = "111523658",//(String)Session["userId"],
            ApplicationInsuranceId = id,
            Type = "INSURANCE",
            Category = "H",
            StartDate = Convert.ToDateTime(this.tb_effectiveDate.Text),
            EndDate = Convert.ToDateTime(this.tb_expiryDate.Text)
        };

        approval.approved();
    }
}